import type { HttpTransaction } from '@/stores/http'

export const mockHttpTransactions: HttpTransaction[] = [
  {
    metadata: {
      process_id: '1234',
      process_exe: '/usr/bin/nginx',
      container_name: 'web-server',
      container_image: 'nginx:latest',
      bytes_sent: 1245,
      bytes_received: 532,
      request_id: 'req-001',
      connection_id: 'conn-001',
    },
    request: {
      method: 'GET',
      url: 'https://api.example.com/api/users',
      scheme: 'https',
      path: '/api/users',
      authority: 'api.example.com',
      protocol: 'HTTP/1.1',
      request_id: 'req-001',
      user_agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
      content_type: 'application/json',
      headers: {
        'Accept': 'application/json',
        'Authorization': 'Bearer token123',
        'Host': 'api.example.com',
      },
    },
    response: {
      status: 200,
      content_type: 'application/json',
      headers: {
        'Content-Type': 'application/json',
        'Cache-Control': 'no-cache',
      },
      body: JSON.stringify({ users: [{ id: 1, name: 'John Doe' }, { id: 2, name: 'Jane Smith' }] }),
    },
    transaction_time: new Date('2025-11-06T10:30:15Z').toISOString(),
    duration_ms: 45,
    direction: 'egress-external',
  },
  {
    metadata: {
      process_id: '1235',
      process_exe: '/usr/bin/node',
      container_name: 'api-server',
      container_image: 'node:18-alpine',
      bytes_sent: 2134,
      bytes_received: 876,
      request_id: 'req-002',
      connection_id: 'conn-002',
    },
    request: {
      method: 'POST',
      url: 'https://api.example.com/api/users',
      scheme: 'https',
      path: '/api/users',
      authority: 'api.example.com',
      protocol: 'HTTP/1.1',
      request_id: 'req-002',
      user_agent: 'PostmanRuntime/7.32.3',
      content_type: 'application/json',
      headers: {
        'Accept': '*/*',
        'Content-Type': 'application/json',
        'Host': 'api.example.com',
      },
      body: JSON.stringify({ name: 'Alice Johnson', email: 'alice@example.com' }),
    },
    response: {
      status: 201,
      content_type: 'application/json',
      headers: {
        'Content-Type': 'application/json',
        'Location': '/api/users/3',
      },
      body: JSON.stringify({ id: 3, name: 'Alice Johnson', email: 'alice@example.com' }),
    },
    transaction_time: new Date('2025-11-06T10:30:20Z').toISOString(),
    duration_ms: 78,
    direction: 'ingress',
  },
  {
    metadata: {
      process_id: '1234',
      process_exe: '/usr/bin/nginx',
      container_name: 'web-server',
      bytes_sent: 987,
      bytes_received: 234,
      request_id: 'req-003',
      connection_id: 'conn-003',
    },
    request: {
      method: 'GET',
      url: 'https://api.example.com/api/products/42',
      scheme: 'https',
      path: '/api/products/42',
      authority: 'api.example.com',
      protocol: 'HTTP/1.1',
      request_id: 'req-003',
      user_agent: 'curl/7.81.0',
      headers: {
        'Accept': '*/*',
        'Host': 'api.example.com',
      },
    },
    response: {
      status: 404,
      content_type: 'application/json',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ error: 'Product not found' }),
    },
    transaction_time: new Date('2025-11-06T10:30:25Z').toISOString(),
    duration_ms: 23,
    direction: 'egress-external',
  },
  {
    metadata: {
      process_id: '1236',
      process_exe: '/usr/local/bin/python3',
      pod_name: 'ml-service-7d8f9b6c5-xkpqr',
      pod_namespace: 'production',
      bytes_sent: 4567,
      bytes_received: 1234,
      request_id: 'req-004',
      connection_id: 'conn-004',
    },
    request: {
      method: 'PUT',
      url: 'https://api.example.com/api/products/1',
      scheme: 'https',
      path: '/api/products/1',
      authority: 'api.example.com',
      protocol: 'HTTP/2',
      request_id: 'req-004',
      user_agent: 'Python/3.11 aiohttp/3.8.5',
      content_type: 'application/json',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'Host': 'api.example.com',
      },
      body: JSON.stringify({ name: 'Updated Product', price: 99.99 }),
    },
    response: {
      status: 200,
      content_type: 'application/json',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ id: 1, name: 'Updated Product', price: 99.99 }),
    },
    transaction_time: new Date('2025-11-06T10:30:30Z').toISOString(),
    duration_ms: 112,
    direction: 'egress-internal',
  },
  {
    metadata: {
      process_id: '1237',
      process_exe: '/usr/bin/java',
      container_name: 'spring-app',
      container_image: 'openjdk:17-slim',
      bytes_sent: 3421,
      bytes_received: 567,
      request_id: 'req-005',
      connection_id: 'conn-005',
    },
    request: {
      method: 'DELETE',
      url: 'https://api.example.com/api/cache/session-123',
      scheme: 'https',
      path: '/api/cache/session-123',
      authority: 'api.example.com',
      protocol: 'HTTP/1.1',
      request_id: 'req-005',
      user_agent: 'Java/17 HttpClient',
      headers: {
        'Accept': '*/*',
        'Authorization': 'Bearer admin-token',
        'Host': 'api.example.com',
      },
    },
    response: {
      status: 204,
      headers: {},
    },
    transaction_time: new Date('2025-11-06T10:30:35Z').toISOString(),
    duration_ms: 18,
    direction: 'egress-external',
  },
  {
    metadata: {
      process_id: '1235',
      process_exe: '/usr/bin/node',
      container_name: 'api-server',
      bytes_sent: 987654,
      bytes_received: 1243,
      request_id: 'req-006',
      connection_id: 'conn-006',
    },
    request: {
      method: 'GET',
      url: 'https://cdn.example.com/assets/images/hero.jpg',
      scheme: 'https',
      path: '/assets/images/hero.jpg',
      authority: 'cdn.example.com',
      protocol: 'HTTP/2',
      request_id: 'req-006',
      user_agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
      headers: {
        'Accept': 'image/webp,image/apng,image/*,*/*',
        'Host': 'cdn.example.com',
      },
    },
    response: {
      status: 200,
      content_type: 'image/jpeg',
      headers: {
        'Content-Type': 'image/jpeg',
        'Cache-Control': 'public, max-age=31536000',
        'ETag': '"abc123"',
      },
      body: '<binary image data>',
    },
    transaction_time: new Date('2025-11-06T10:30:40Z').toISOString(),
    duration_ms: 234,
    direction: 'egress-external',
  },
  {
    metadata: {
      process_id: '1238',
      process_exe: '/opt/app/server',
      pod_name: 'auth-service-6b8c9d5-mn4pr',
      pod_namespace: 'production',
      bytes_sent: 543,
      bytes_received: 2341,
      request_id: 'req-007',
      connection_id: 'conn-007',
    },
    request: {
      method: 'POST',
      url: 'https://api.example.com/api/auth/login',
      scheme: 'https',
      path: '/api/auth/login',
      authority: 'api.example.com',
      protocol: 'HTTP/1.1',
      request_id: 'req-007',
      user_agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
      content_type: 'application/json',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'Host': 'api.example.com',
      },
      body: JSON.stringify({ username: 'admin', password: '********' }),
    },
    response: {
      status: 200,
      content_type: 'application/json',
      headers: {
        'Content-Type': 'application/json',
        'Set-Cookie': 'session=xyz; HttpOnly; Secure',
      },
      body: JSON.stringify({ token: 'jwt.token.here', expires_in: 3600 }),
    },
    transaction_time: new Date('2025-11-06T10:30:45Z').toISOString(),
    duration_ms: 156,
    direction: 'ingress',
  },
  {
    metadata: {
      process_id: '1239',
      process_exe: '/usr/bin/redis-server',
      container_name: 'cache',
      container_image: 'redis:7-alpine',
      bytes_sent: 234,
      bytes_received: 1234,
      request_id: 'req-008',
      connection_id: 'conn-008',
    },
    request: {
      method: 'GET',
      url: 'http://internal-api:8080/health',
      scheme: 'http',
      path: '/health',
      authority: 'internal-api:8080',
      protocol: 'HTTP/1.1',
      request_id: 'req-008',
      user_agent: 'k8s-probe/1.28',
      headers: {
        'Accept': '*/*',
        'Host': 'internal-api:8080',
      },
    },
    response: {
      status: 200,
      content_type: 'text/plain',
      headers: {
        'Content-Type': 'text/plain',
      },
      body: 'OK',
    },
    transaction_time: new Date('2025-11-06T10:30:50Z').toISOString(),
    duration_ms: 3,
    direction: 'ingress',
  },
  {
    metadata: {
      process_id: '1240',
      process_exe: '/usr/bin/node',
      container_name: 'webhook-handler',
      bytes_sent: 876,
      bytes_received: 4532,
      request_id: 'req-009',
      connection_id: 'conn-009',
    },
    request: {
      method: 'POST',
      url: 'https://api.example.com/webhooks/stripe',
      scheme: 'https',
      path: '/webhooks/stripe',
      authority: 'api.example.com',
      protocol: 'HTTP/1.1',
      request_id: 'req-009',
      user_agent: 'Stripe/1.0',
      content_type: 'application/json',
      headers: {
        'Accept': '*/*',
        'Content-Type': 'application/json',
        'Stripe-Signature': 't=1699276800,v1=abc123',
        'Host': 'api.example.com',
      },
      body: JSON.stringify({ type: 'payment_intent.succeeded', data: { amount: 5000 } }),
    },
    response: {
      status: 200,
      content_type: 'application/json',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ received: true }),
    },
    transaction_time: new Date('2025-11-06T10:30:55Z').toISOString(),
    duration_ms: 89,
    direction: 'ingress',
  },
  {
    metadata: {
      process_id: '1234',
      process_exe: '/usr/bin/nginx',
      container_name: 'web-server',
      bytes_sent: 543,
      bytes_received: 123,
      request_id: 'req-010',
      connection_id: 'conn-010',
    },
    request: {
      method: 'GET',
      url: 'https://api.example.com/api/stats',
      scheme: 'https',
      path: '/api/stats',
      authority: 'api.example.com',
      protocol: 'HTTP/1.1',
      request_id: 'req-010',
      user_agent: 'Prometheus/2.45.0',
      headers: {
        'Accept': 'application/json',
        'Host': 'api.example.com',
      },
    },
    response: {
      status: 500,
      content_type: 'application/json',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ error: 'Internal server error', message: 'Database connection failed' }),
    },
    transaction_time: new Date('2025-11-06T10:31:00Z').toISOString(),
    duration_ms: 5002,
    direction: 'ingress',
  },
]

